/**
 * Created by root on 2015/1/13.
 */

var mongoose = require('mongoose');
require('../../expansion/EModel.js');
var Question = mongoose.model('Question');

function QuestionService(){

}
QuestionService.prototype.getAllQuestionByStore = function(condition, populate, pages, columns, sort, callback) {
    Question.findPagination(condition, populate, pages, columns, sort, callback);
}


QuestionService.prototype.updateQuestion = function (qid, updateData, callback) {
    Question.findByIdAndUpdate(qid, updateData,function (err, data) {
        if(err) throw err;
        callback && callback(err, data);
    });
};

module.exports = QuestionService;